home *** CD-ROM | disk | FTP | other *** search
/ The Canadian & World Encyclopedia 1998 / The Canadian & World Encyclopedia 1998 - Disc 2.iso / mac / prime_CD / pb / PREVIEW.DIR / 00148_Script_slide control parent < prev    next >
Text File  |  1997-07-22  |  2KB  |  70 lines

  1. property slideRange, currentSlide, displayChan, slideTotal, cursorHolder
  2.  
  3. ------ these are the only ones you need to call
  4.  
  5. on next me
  6.   waitTheCursor me
  7.   bumpSlide me, 1, 2, 16, TRUE
  8.   deWaitTheCursor me
  9. end
  10.  
  11. on prev me
  12.   waitTheCursor me
  13.   bumpSlide me, -1, 2, 16, TRUE
  14.   deWaitTheCursor me
  15. end
  16.  
  17. ----------------------------------------------
  18.  
  19. on new me, slideMemberRange, imageChannel -- e.g. [40,69], gSSimageChan
  20.   init me, slideMemberRange, imageChannel  
  21.   --  put "slide changer initialized"
  22.   put "1 of" && slideTotal into field "legend"
  23.   return me
  24. end
  25.  
  26. on init me, slideMemberRange, imageChannel
  27.   set slideRange = slideMemberRange
  28.   set currentSlide = getAt(slideRange,1)  
  29.   set displayChan = imageChannel  
  30.   set slideTotal = getAt(slideRange,2) - getAt(slideRange,1) + 1
  31.   puppetsprite displayChan, TRUE
  32.   set the trails of sprite displayChan = TRUE
  33.   return me
  34. end
  35.  
  36. --puppetTransition whichTransition, 6, 64, TRUE
  37.  
  38. on bumpSlide me, howMuch, trQuartSecs, trChunkSize, trChangedOnly
  39.   if howMuch > 0 then set whichTransition = 2
  40.   else set whichTransition = 1
  41.   set currentSlide = currentSlide + howMuch
  42.   
  43.   -- wrap if hi
  44.   if currentSlide > getAt(slideRange,2) then set currentSlide = getAt(slideRange,1)
  45.   
  46.   -- wrap if lo
  47.   if currentSlide < getAt(slideRange,1) then set currentSlide = getAt(slideRange,2)
  48.   
  49.   puppetsprite displayChan, 1
  50.   set the memberNum of sprite displayChan to the number of member currentSlide
  51.   puppetTransition whichTransition, trQuartSecs, trChunkSize, trChangedOnly
  52.   --  put integer(word 1 of field "legend") into theSlideNum
  53.   --  updatestage
  54.   set theSlideNum = (currentSlide - getAt(slideRange,1)) + 1 -- + howMuch
  55.   put theSlideNum into word 1 of field "legend"
  56. end
  57.  
  58.  
  59. on waitTheCursor me
  60.   set cursorHolder = the cursor of sprite the clickon
  61.   set the cursor of sprite the clickon to 4
  62.   cursor 4
  63.   return me
  64. end
  65.  
  66. on deWaitTheCursor me
  67.   set the cursor of sprite the clickon to cursorHolder
  68.   cursor -1
  69.   return me
  70. end